﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My MVC Admin Template</title>
    @Styles.Render("~/Content/Bootstraptheme")
    @Styles.Render("~/Content/adminCss")
    @*Styles.Render("~/bootgrid/css")*@
    @*Scripts.Render("~/bundles/modernizr")*@
    
    
    @Styles.Render("~/Content/Vendors")

    @Scripts.Render("~/bundles/knockout")
    @Scripts.Render("~/Scripts/jquery-1.10.js")
    @{
        string upath = Convert.ToString(HttpContext.Current.Application["AppPath"]);
    }
    <script type="text/javascript" src="~/Scripts/JsLib.js" charset="utf-8"></script>
    <script type="text/javascript">
        var rootpath = "@upath";
        approotpath = rootpath;
    </script>
</head>
<body class="bootstrap-admin-with-small-navbar">
   
    <!-- main / large navbar -->
    <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="row">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".main-navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/">Admin Panel</a>
                </div>
                <div class="collapse navbar-collapse main-navbar-collapse">
                    <!--
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="#">Link</a></li>
                        <li><a href="#">Link</a></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-hover="dropdown">Dropdown <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li role="presentation" class="dropdown-header">Dropdown header</li>
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li role="presentation" class="divider"></li>
                                <li role="presentation" class="dropdown-header">Dropdown header</li>
                                <li><a href="#">Separated link</a></li>
                                <li><a href="#">One more separated link</a></li>
                            </ul>
                        </li>
                    </ul>
                    -->
                    <div class="collapse navbar-collapse bootstrap-admin-navbar-sm">
                        <ul class="nav navbar-nav navbar-right ">
                            <!--<li><a href="#">Link</a></li>
                            <li><a href="#">Link</a></li>
                            <li>
                                <a href="#">Reminders <i class="glyphicon glyphicon-bell"></i></a>
                            </li>
                            <li>
                                <a href="#">Settings <i class="glyphicon glyphicon-cog"></i></a>
                            </li>
                            <li>
                                <a href="#">Go to frontend <i class="glyphicon glyphicon-share-alt"></i></a>
                            </li>-->
                            @Html.Partial("_LoginPartial")
                        </ul>
                    </div>
                </div><!-- /.navbar-collapse -->
            </div>
        </div><!-- /.container -->
    </nav>
    <div class="container">
        <div class="row">
            @{
                if(Request.QueryString!=null && Request.QueryString.AllKeys.Contains("errCode")){
                    int ecode=0;
                    if(Int32.TryParse(Convert.ToString(Request.QueryString["errCode"]),out ecode)){
                        if(ecode==250){
                         <div class="alert alert-success" id="success-alert">
                            <button type="button" class="close" data-dismiss="alert">x</button>
                            <strong>Success! </strong>
                            @Convert.ToString(Request.QueryString["msgJson"])
                        </div>
                        }
                        else if(ecode>=100 && ecode<=105){   
                        <div class="alert alert-danger" id="error-alert">
                            <button type="button" class="close" data-dismiss="alert">x</button>
                            <strong>Error! </strong>
                            @Convert.ToString(Request.QueryString["msgJson"])
                        </div>
                        }
                        else{   
                        <div class="alert alert-info" id="info-alert">
                            <button type="button" class="close" data-dismiss="alert">x</button>
                            <strong>Attention! </strong>
                            @Convert.ToString(Request.QueryString["msgJson"])
                        </div>
                        }
                    }
                }
            }

            @RenderBody()
        </div>
        <div class="row">
            <hr>
            <footer role="contentinfo">
                <p>&copy;  @DateTime.Now.Year -  <a href="https://github.com/jrocket" target="_blank">Sujeet</a></p>
            </footer>
        </div>
    </div>


    
    @*Scripts.Render("~/bootgrid/jquery")*@
    @Scripts.Render("~/bundles/bootstrap")
    @Scripts.Render("~/bundles/vendors")
    
    @RenderSection("scripts", required: false)

   <script type="text/javascript">
       if (document.getElementById("success-alert")) {
           $("#success-alert").fadeTo(2000, 500).slideUp(500, function () {
               $("#success-alert").alert('close');
           });
       }
       if (document.getElementById("error-alert")) {
           $("#error-alert").fadeTo(2000, 500).slideUp(500, function () {
               $("#error-alert").alert('close');
           });

       }
       if (document.getElementById("info-alert")) {
           $("#info-alert").fadeTo(1000*60, 500).slideUp(500, function () {
               $("#error-alert").alert('close');
           });

       }

       $('#confirm-delete').on('show.bs.modal', function (e) {
           $(this).find('.danger').attr('href', $(e.relatedTarget).data('href'));
       });

       function htmlEncode(value) {
           if (value) {
               return jQuery('<div />').text(value).html();
           } else {
               return "";
           }
       }
       function htmlDecode(value) {
           if (value) {
               return $('<div />').html(value).text();
           } else {
               return "";
           }
       }
   </script>
</body>
    <!-- modal popups -->
<script type="text/html" id="del_popup">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                {header}
            </div>
            <div class="modal-body">
                {body}
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                <a href="#" class="btn btn-danger danger"  data-toggle="modal" data-target="#myModal" onclick="{functionname}({itemid},'{target}')">Delete</a>
            </div>
        </div>
    </div>
    
</script>
<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
    
</html>
